﻿// 皮肤选择	
window._demoSkin = function () {
	$.dialog({
		id: 'demoSkin',
		padding: '15px',
		title: '皮肤展示',
		content: _demoSkin.tmpl
	});
};
_demoSkin.tmpl = function (data) {
	var html = ['<table class="zebra" style="width:480px"><tbody>'];
	for (var i = 0, length = data.length; i < length; i ++) {
		html.push('<tr class="');
		html.push(i%2 ? 'odd' : '');
		html.push('"><th style="width:7em">');
		html.push('<a href="javascript:void(0)" onclick=\"chkSkin(\''+data[i].name+'\')\">');
		html.push(data[i].name);
		html.push('</a>');
		html.push('</a></th><td>');
		html.push(data[i].about);
		html.push('</td></tr>');
	};
	html.push('</tbody></table>');
	return html.join('');
}([
	{name: 'default', about: '蓝色简约风格风格'},
	{name: 'iblue', about: '简洁蓝色半透明风格'},
	{name: 'igreen', about: '简洁绿色半透明风格'},
	{name: 'iblack', about: '简洁黑色半透明风格'},
	{name: 'blue', about: '浅蓝色风格'},
	{name: 'chrome', about: 'chrome浏览器(xp)风格'},
	{name: 'discuz', about: 'discuz论坛登录窗口风格'},
	{name: 'jtop', about: '仿cmstop内容管理系统窗口风格'},
	{name: 'mac', about: '灰色简约风格'},
	{name: 'idialog', about: '苹果电脑风格的弹窗风格'}
]);

$(function(){
	var $skin = $('#demo_skin');
	if (!$skin[0]) return;	
	$skin.bind('click', function () {
		_demoSkin();
		return false;
	});
});
function chkSkin(s){	
	$.cookie("daSkin", s, { path: '/', expires: 310 });  
	window.location.reload();
}